namespace Romer
{
    using Romer.Properties;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class Options : Form
    {
        private Button button1;
        private Button button2;
        private IContainer components;
        private CheckBox FixHead;
        private CheckBox FixLen;
        private CheckBox FixSize;
        private CheckBox FixUnit;
        private CheckBox ForceLogo;
        private Label label1;
        private Label label2;
        private Label label3;
        private Label label4;
        private Label label5;
        private Label label6;
        private Label label7;
        private TableLayoutPanel tableLayoutPanel1;

        public Options()
        {
            this.InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Settings.Default.checksum = this.FixHead.Checked;
            Settings.Default.pointer = this.FixLen.Checked;
            Settings.Default.unitcode = this.FixUnit.Checked;
            Settings.Default.headersize = this.FixSize.Checked;
            Settings.Default.forcelogo = this.ForceLogo.Checked;
            base.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void ChangeSetting()
        {
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FixHead_CheckedChanged(object sender, EventArgs e)
        {
            this.ChangeSetting();
        }

        private void FixLen_CheckedChanged(object sender, EventArgs e)
        {
            this.ChangeSetting();
        }

        private void FixSize_CheckedChanged(object sender, EventArgs e)
        {
            this.ChangeSetting();
        }

        private void FixUnit_CheckedChanged(object sender, EventArgs e)
        {
            this.ChangeSetting();
        }

        private void ForceLogo_CheckedChanged(object sender, EventArgs e)
        {
            this.ChangeSetting();
        }

        private void InitializeComponent()
        {
            this.tableLayoutPanel1 = new TableLayoutPanel();
            this.label1 = new Label();
            this.label2 = new Label();
            this.label5 = new Label();
            this.label3 = new Label();
            this.label6 = new Label();
            this.label4 = new Label();
            this.FixHead = new CheckBox();
            this.FixLen = new CheckBox();
            this.FixUnit = new CheckBox();
            this.FixSize = new CheckBox();
            this.ForceLogo = new CheckBox();
            this.button1 = new Button();
            this.button2 = new Button();
            this.label7 = new Label();
            this.tableLayoutPanel1.SuspendLayout();
            base.SuspendLayout();
            this.tableLayoutPanel1.ColumnCount = 2;
            this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 75.62189f));
            this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 24.37811f));
            this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
            this.tableLayoutPanel1.Controls.Add(this.label5, 0, 2);
            this.tableLayoutPanel1.Controls.Add(this.label3, 0, 3);
            this.tableLayoutPanel1.Controls.Add(this.label6, 0, 4);
            this.tableLayoutPanel1.Controls.Add(this.label4, 0, 5);
            this.tableLayoutPanel1.Controls.Add(this.FixHead, 1, 1);
            this.tableLayoutPanel1.Controls.Add(this.FixLen, 1, 2);
            this.tableLayoutPanel1.Controls.Add(this.FixUnit, 1, 3);
            this.tableLayoutPanel1.Controls.Add(this.FixSize, 1, 4);
            this.tableLayoutPanel1.Controls.Add(this.ForceLogo, 1, 5);
            this.tableLayoutPanel1.Location = new Point(9, 12);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 7;
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f));
            this.tableLayoutPanel1.Size = new Size(0xc9, 0x80);
            this.tableLayoutPanel1.TabIndex = 0;
            this.label1.AutoSize = true;
            this.label1.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Underline | FontStyle.Bold, GraphicsUnit.Point, 0);
            this.label1.ForeColor = Color.RoyalBlue;
            this.label1.Location = new Point(3, 0);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x6f, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "Advanced Options";
            this.label2.AutoSize = true;
            this.label2.Location = new Point(3, 20);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x71, 13);
            this.label2.TabIndex = 1;
            this.label2.Text = "Fix Header checksum:";
            this.label5.AutoSize = true;
            this.label5.Location = new Point(3, 40);
            this.label5.Name = "label5";
            this.label5.Size = new Size(0x5b, 13);
            this.label5.TabIndex = 4;
            this.label5.Text = "Fix length Pointer:";
            this.label3.AutoSize = true;
            this.label3.Location = new Point(3, 60);
            this.label3.Name = "label3";
            this.label3.Size = new Size(0x49, 13);
            this.label3.TabIndex = 2;
            this.label3.Text = "Fix Unit Code:";
            this.label6.AutoSize = true;
            this.label6.Location = new Point(3, 80);
            this.label6.Name = "label6";
            this.label6.Size = new Size(0x60, 13);
            this.label6.TabIndex = 5;
            this.label6.Text = "Force Header size:";
            this.label4.AutoSize = true;
            this.label4.Location = new Point(3, 100);
            this.label4.Name = "label4";
            this.label4.Size = new Size(0x86, 13);
            this.label4.TabIndex = 3;
            this.label4.Text = "Force Logo CRC (0xCF56):";
            this.FixHead.AutoSize = true;
            this.FixHead.Location = new Point(0x9a, 0x17);
            this.FixHead.Name = "FixHead";
            this.FixHead.Size = new Size(15, 14);
            this.FixHead.TabIndex = 6;
            this.FixHead.UseVisualStyleBackColor = true;
            this.FixHead.CheckedChanged += new EventHandler(this.FixHead_CheckedChanged);
            this.FixLen.AutoSize = true;
            this.FixLen.Location = new Point(0x9a, 0x2b);
            this.FixLen.Name = "FixLen";
            this.FixLen.Size = new Size(15, 14);
            this.FixLen.TabIndex = 7;
            this.FixLen.UseVisualStyleBackColor = true;
            this.FixLen.CheckedChanged += new EventHandler(this.FixLen_CheckedChanged);
            this.FixUnit.AutoSize = true;
            this.FixUnit.Location = new Point(0x9a, 0x3f);
            this.FixUnit.Name = "FixUnit";
            this.FixUnit.Size = new Size(15, 14);
            this.FixUnit.TabIndex = 8;
            this.FixUnit.UseVisualStyleBackColor = true;
            this.FixUnit.CheckedChanged += new EventHandler(this.FixUnit_CheckedChanged);
            this.FixSize.AutoSize = true;
            this.FixSize.Location = new Point(0x9a, 0x53);
            this.FixSize.Name = "FixSize";
            this.FixSize.Size = new Size(15, 14);
            this.FixSize.TabIndex = 9;
            this.FixSize.UseVisualStyleBackColor = true;
            this.FixSize.CheckedChanged += new EventHandler(this.FixSize_CheckedChanged);
            this.ForceLogo.AutoSize = true;
            this.ForceLogo.Location = new Point(0x9a, 0x67);
            this.ForceLogo.Name = "ForceLogo";
            this.ForceLogo.Size = new Size(15, 14);
            this.ForceLogo.TabIndex = 10;
            this.ForceLogo.UseVisualStyleBackColor = true;
            this.ForceLogo.CheckedChanged += new EventHandler(this.ForceLogo_CheckedChanged);
            this.button1.Location = new Point(0x73, 0xbd);
            this.button1.Name = "button1";
            this.button1.Size = new Size(0x5c, 0x15);
            this.button1.TabIndex = 1;
            this.button1.Text = "Apply";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new EventHandler(this.button1_Click);
            this.button2.DialogResult = DialogResult.Cancel;
            this.button2.Location = new Point(6, 0xbd);
            this.button2.Name = "button2";
            this.button2.Size = new Size(0x5c, 0x16);
            this.button2.TabIndex = 2;
            this.button2.Text = "Cancel";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += new EventHandler(this.button2_Click);
            this.label7.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            this.label7.Location = new Point(9, 0x8f);
            this.label7.Name = "label7";
            this.label7.Size = new Size(0xc9, 0x2b);
            this.label7.TabIndex = 3;
            this.label7.Text = "All options should be on by default,  if you don't know what they do just leave them on";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0xdb, 0xde);
            base.Controls.Add(this.label7);
            base.Controls.Add(this.button2);
            base.Controls.Add(this.button1);
            base.Controls.Add(this.tableLayoutPanel1);
            base.FormBorderStyle = FormBorderStyle.FixedDialog;
            base.MaximizeBox = false;
            this.MaximumSize = new Size(0xe3, 0x100);
            base.MinimizeBox = false;
            this.MinimumSize = new Size(0xe3, 0x100);
            base.Name = "Options";
            this.Text = "Options";
            base.TopMost = true;
            base.Load += new EventHandler(this.Options_Load);
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel1.PerformLayout();
            base.ResumeLayout(false);
        }

        private void Options_Load(object sender, EventArgs e)
        {
            this.FixHead.Checked = Settings.Default.checksum;
            this.FixLen.Checked = Settings.Default.pointer;
            this.FixUnit.Checked = Settings.Default.unitcode;
            this.FixSize.Checked = Settings.Default.headersize;
            this.ForceLogo.Checked = Settings.Default.forcelogo;
        }
    }
}

